 /**
 * DISCLIMER: 
 * this library is an opensource, feel free to edit or redistribute it
 * but use it with you own risk
 * 
 * ktutnik
 */

package org.ticlib.events
{
	import flash.events.Event;
	
	public class ConfirmationEvent extends NotificationEvent
	{
		public static const SHOW:String = "confirmationShow";
		public static const TYPE_INFORMATION:String = "confirmationInformation";
		public static const TYPE_ERROR:String = "confirmationError";
		public static const TYPE_WARNING:String = "confirmationWarning";
		
		public var pendingEvent:Event;

		public function ConfirmationEvent(type:String, bubbles:Boolean=false, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
		}

		public static function info(message:String, pendingEvent:Event):ConfirmationEvent
		{
			var e:ConfirmationEvent = new ConfirmationEvent(ConfirmationEvent.SHOW, true);
			e.message = message;
			e.messageType = TYPE_INFORMATION;
			e.pendingEvent = pendingEvent;
			return e;
		}
		
		public static function warning(message:String, pendingEvent:Event):ConfirmationEvent
		{
			var e:ConfirmationEvent = new ConfirmationEvent(ConfirmationEvent.SHOW, true);
			e.message = message;
			e.messageType = TYPE_WARNING;
			e.pendingEvent = pendingEvent;
			return e;
		}
		
		public static function error(message:String, pendingEvent:Event):ConfirmationEvent
		{
			var e:ConfirmationEvent = new ConfirmationEvent(ConfirmationEvent.SHOW, true);
			e.message = message;
			e.messageType = TYPE_ERROR;
			e.pendingEvent = pendingEvent;
			return e;
		}
	}
}